package lamda;

/**
 * @auther 黄伟
 * @description 测试二：自定义接口实现-加减乘除
 * @date 2019/3/26
 */
public class LamdaTest02 {
    // java程序入口
    public static void main(String[] ages){
        CustomAdd add = (double a,double b)->a + b;
        System.out.println(add.add(12,5)) ; // 打印输出信息
        CustomMinus minus  = (double a,double b)->a - b;
        System.out.println(minus.minus(12,5)) ; // 打印输出信息
        CustomRate rate = (double a,double b)->a * b;
        System.out.println(rate.rate(12,5)) ; // 打印输出信息
        CustomDivide divide = (double a,double b)->a / b;
        System.out.println(divide.divide(12,5)) ; // 打印输出信息
    }
}

@FunctionalInterface
interface CustomAdd {
    double add(double a, double b);
}
@FunctionalInterface
interface CustomMinus {
    double minus(double a, double b);
}
@FunctionalInterface
interface CustomRate {
    double rate(double a, double b);
}
@FunctionalInterface
interface CustomDivide {
    double divide(double a, double b);
}
